package com.caigou.mapper.cms;

import com.caigou.bean.cms.entity.SurveySubmit;
import com.caigou.bean.cms.param.QueryFormParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository("SurveySubmitUserMapper")
public interface SurveySubmitMapper {
    int loadUserAnswerCount(@Param("formId") String formId, @Param("userId") String userId, @Param("deviceId") String deviceId);

    int loadUserAnswerCountByUser(@Param("formId") String formId, @Param("userId") String userId);

    int loadUserTodayCount(@Param("formId") String formId, @Param("userId") String userId, @Param("deviceId") String deviceId);

    int saveSurveySubmitUser(@Param("formId") String formId, @Param("userId") String userId, @Param("deviceId") String deviceId, @Param("answerId") String answerId);

    List<SurveySubmit> loadSurveySubmit(@Param("formId") String formId, @Param("startTime") String startTime, @Param("endTime") String endTime,
                                        @Param("startPage") Integer startPage, @Param("pageSize") Integer pageSize);

    Long loadSurveySubmitTotal(@Param("formId") String formId, @Param("startTime") String startTime, @Param("endTime") String endTime);
}
